package sac.modelo.data.maestros;

/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: 
 * License Type: Evaluation
 */
import java.io.Serializable;
import javax.persistence.*;

import sac.modelo.data.transacciones.Lactancia;
import sac.modelo.data.transacciones.Servicio;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="Cabra")
public class Cabra implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public Cabra() {
	}
	
	@Column(name="numero", nullable=false)	
	@Id		
	private int numero;
	
	@ManyToOne(targetEntity=Animal.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="Animalid_animal", referencedColumnName="id_animal", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	private Animal animalid_animal;
	
	@OneToMany(mappedBy="cabranumero", targetEntity=Servicio.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	private java.util.Set<Servicio> servicio = new java.util.HashSet<Servicio>();
	
	@OneToMany(mappedBy="cabranumero", targetEntity=Lactancia.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	private java.util.Set<Lactancia> lactancia = new java.util.HashSet<Lactancia>();
	
	private void setNumero(int value) {
		this.numero = value;
	}
	
	public int getNumero() {
		return numero;
	}
	
	public int getORMID() {
		return getNumero();
	}
	
	public void setAnimalid_animal(Animal value) {
		this.animalid_animal = value;
	}
	
	public Animal getAnimalid_animal() {
		return animalid_animal;
	}
	
	public void setServicio(java.util.Set<Servicio> value) {
		this.servicio = value;
	}
	
	public java.util.Set<Servicio> getServicio() {
		return servicio;
	}
	
	
	public void setLactancia(java.util.Set<Lactancia> value) {
		this.lactancia = value;
	}
	
	public java.util.Set<Lactancia> getLactancia() {
		return lactancia;
	}
	
	
	public String toString() {
		return String.valueOf(getNumero());
	}
	
}
